/***********************************************************************
 * Module:  Guardian.java
 * Author:  penwei
 * Purpose: 学生的监护人
 ***********************************************************************/

package cn.hdmis.entity;

import java.util.*;
/**
 * 项目名称：hdmis1.1
 * 类名称：Guardian
 * 类描述：监护人
 * 创建人：Administrator
 * 创建时间：2013-2-13 下午02:47:49
 * 修改人：Administrator
 * 修改时间：2013-2-13 下午02:47:49
 * 修改备注：
 * @version 
 *
 */
public class Guardian implements java.io.Serializable {
	private static final long serialVersionUID = -442609457183745215L;
	/**	编号 */
	private Long id;
	/**	监护人姓名 */
	private String name;
	/**	年龄 */
	private Integer age;
	/**证件类型 */
	private Integer cardType;
	/**证件号 */
	private String idCard;
	/**	性别 */
	private Integer sex;
	/**	关系 */
	private Integer relationship;
	/**	联系电话 */
	private String phone1;
	private String phone2;
	/**	工作单位 */
	private String unit;
	/**	单位电话 */
	private String unitPhone;
	/**	是否可用 */
	private Boolean status;
	/**	停用时间 */
	private Date disableDate;
	/** 多个监护人对一个学生*/
	private Student student;

	public Guardian() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * Get value of id
	 * 
	 * @return id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * Set value of id
	 * 
	 * @param newId
	 */
	public void setId(Long newId) {
		this.id = newId;
	}

	/**
	 * Get value of name
	 * 
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Set value of name
	 * 
	 * @param newName
	 */
	public void setName(String newName) {
		this.name = newName;
	}

	/**
	 * Get value of age
	 * 
	 * @return age
	 */
	public Integer getAge() {
		return age;
	}

	/**
	 * Set value of age
	 * 
	 * @param newAge
	 */
	public void setAge(Integer newAge) {
		this.age = newAge;
	}

	public void setCardType(Integer cardType) {
		this.cardType = cardType;
	}

	public Integer getCardType() {
		return cardType;
	}

	/**
	 * Get value of idCard
	 * 
	 * @return idCard
	 */
	public String getIdCard() {
		return idCard;
	}

	/**
	 * Set value of idCard
	 * 
	 * @param newIdCard
	 */
	public void setIdCard(String newIdCard) {
		this.idCard = newIdCard;
	}

	/**
	 * Get value of gender
	 * 
	 * @return gender
	 */
	public Integer getSex() {
		return sex;
	}

	/**
	 * Set value of gender
	 * 
	 * @param newGender
	 */
	public void setSex(Integer sex) {
		this.sex = sex;
	}

	/**
	 * Get value of relationship
	 * 
	 * @return relationship
	 */
	public Integer getRelationship() {
		return relationship;
	}

	/**
	 * Set value of relationship
	 * 
	 * @param newRelationship
	 */
	public void setRelationship(Integer newRelationship) {
		this.relationship = newRelationship;
	}

	/**
	 * Get value of phone1
	 * 
	 * @return phone1
	 */
	public String getPhone1() {
		return phone1;
	}

	/**
	 * Set value of phone1
	 * 
	 * @param newPhone1
	 */
	public void setPhone1(String newPhone1) {
		this.phone1 = newPhone1;
	}

	/**
	 * Get value of phone2
	 * 
	 * @return phone2
	 */
	public String getPhone2() {
		return phone2;
	}

	/**
	 * Set value of phone2
	 * 
	 * @param newPhone2
	 */
	public void setPhone2(String newPhone2) {
		this.phone2 = newPhone2;
	}

	/**
	 * Get value of unit
	 * 
	 * @return unit
	 */
	public String getUnit() {
		return unit;
	}

	/**
	 * Set value of unit
	 * 
	 * @param newUnit
	 */
	public void setUnit(String newUnit) {
		this.unit = newUnit;
	}

	/**
	 * Get value of unitPhone
	 * 
	 * @return unitPhone
	 */
	public String getUnitPhone() {
		return unitPhone;
	}

	/**
	 * Set value of unitPhone
	 * 
	 * @param newUnitPhone
	 */
	public void setUnitPhone(String newUnitPhone) {
		this.unitPhone = newUnitPhone;
	}

	/**
	 * Get value of status
	 * 
	 * @return status
	 */
	public Boolean getStatus() {
		return status;
	}

	/**
	 * Set value of status
	 * 
	 * @param newStatus
	 */
	public void setStatus(Boolean newStatus) {
		this.status = newStatus;
	}

	/**
	 * Get value of disableDate
	 * 
	 * @return disableDate
	 */
	public Date getDisableDate() {
		return disableDate;
	}

	/**
	 * Set value of disableDate
	 * 
	 * @param newDisableDate
	 */
	public void setDisableDate(Date newDisableDate) {
		this.disableDate = newDisableDate;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {

		if (obj == null)
			return false;

		if (obj == this)
			return true;

		if (!(obj instanceof Guardian))
			return false;
		else{
			Guardian gd = (Guardian)obj;
			return this.id == gd.getId();
		
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		int hashCode = 0;
		if (this.id != null)
			hashCode = 29 * hashCode + id.hashCode();
		if (this.name != null)
			hashCode = 29 * hashCode + name.hashCode();
		if (this.age != null)
			hashCode = 29 * hashCode + age.hashCode();
		if (this.idCard != null)
			hashCode = 29 * hashCode + idCard.hashCode();
		if (this.sex != null)
			hashCode = 29 * hashCode + sex.hashCode();
		if (this.relationship != null)
			hashCode = 29 * hashCode + relationship.hashCode();
		if (this.phone1 != null)
			hashCode = 29 * hashCode + phone1.hashCode();
		if (this.phone2 != null)
			hashCode = 29 * hashCode + phone2.hashCode();
		if (this.unit != null)
			hashCode = 29 * hashCode + unit.hashCode();
		if (this.unitPhone != null)
			hashCode = 29 * hashCode + unitPhone.hashCode();
		if (this.status != null)
			hashCode = 29 * hashCode + status.hashCode();
		if (this.disableDate != null)
			hashCode = 29 * hashCode + disableDate.hashCode();
		return hashCode;
	}

}